package com.example.hotelmanagement.service.impl;

import com.example.hotelmanagement.entity.Staff;
import com.example.hotelmanagement.mapper.StaffMapper;
import com.example.hotelmanagement.service.StaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StaffServiceImpl implements StaffService {

    @Autowired
    private StaffMapper staffMapper;

    @Override
    public List<Staff> findAll() {
        return staffMapper.findAll();
    }

    @Override
    public Staff findById(Integer staffId) {
        return staffMapper.findById(staffId);
    }

    @Override
    public Staff findByUserId(Integer userId) {
        return staffMapper.findByUserId(userId);
    }

    @Override
    public int save(Staff staff) {
        return staffMapper.insert(staff);
    }

    @Override
    public int update(Staff staff) {
        return staffMapper.update(staff);
    }

    @Override
    public int delete(Integer staffId) {
        return staffMapper.delete(staffId);
    }
}